import request from './request.js';
let service = request.service;
let formatterUrl = request.formatterUrl;
// 获取问诊列表
export function queryTreatments(data) {
  return service({
    url: '/adscm/application/hTreatment/queryTreatments',
    method: 'post',
    data
  })
}
// 问诊叫号
export function calling(id) {
  return service({
    url: `/adscm/application/hTreatment/callById/${id}`,
    method: 'get'
  })
}
//获取体检项-当日体征监测数据
export function todayVitalSigns(bodyRecodeId) {
   return service({
     url: `/adscm/application/bodyCheck/selectByBodyRecodeId/${bodyRecodeId}`, 
     method: 'get',
   })
 }
 //获取体检项-历史体征数据列表
export function historyVitalSignsList(providerId) {
  return service({
    url: `/adscm/application/bodyCheck/queryHistorySmtz/${providerId}`,
    method: 'get',
  })
}
//体检项-脉波压力检测获取当日数据
export function queryBloodvessel(bodyCheckId) {
  return service({
    url: `/adscm/application/bodyCheckOther/queryBloodvessel/${bodyCheckId}`, //查询精神&压力数据
    method: 'get',
  })
}
//体检项-脉波压力检测获取历史数据
export function queryBloodvesselList(providerId) {
  return service({
    url: `/adscm/application/bodyCheckOther/queryBloodvesselList/${providerId}`,
    method: 'get',
  })
}
//体检项-微循环检测获取列表
export function queryMicrocirculation(bodyCheckId) {
  return service({
    url: `/adscm/application/bodyCheckOther/selectByBid/${bodyCheckId}`,
    method: 'get'
  })
}
//体检项-微循环检测视频上传
export function idImgUploadForMicrocirculation(bodyCheckId) {
    return formatterUrl({
      url: `/adscm/application/bodyCheckOther/uploadWxhVideo/${bodyCheckId}`
    })
}
//体检项-微循环检测新增
export function insertMicrocirculation(data) {
    return service({
      url: `/adscm/application/bodyCheckOther/insert`,
      method: 'post',
      data
    })
}
//体检项-微循环检测 修改
export function updateMicrocirculation(data) {
    return service({
      url: `/adscm/application/bodyCheckOther/update`,
      method: 'post',
      data
    })
}
//身体检测-查询当日身体检测
export function getPhysicalExaminationToday(hid) {
  return service({
    url: `/adscm/application/hTreatmentBodycheck/selectByHid/${hid}`, 
    method: 'get',
  })
}
/**身体检测-获取历史记录*/ 
export function getPhysicalExaminationHistory(providerId) {
  return service({
    url: `/adscm/application/hTreatmentBodycheck/selectHistory/${providerId}`, //查询某个人的历史身体检测记录
    method: 'get',
  })
}
/**身体检测-新增修改当日身体检测*/
export function updatePhysicalExaminationToday(data) {
  /**新增今天的数据*/
  return service({
    url: `/adscm/application/hTreatmentBodycheck/updateOrInsert`,
    method: 'post',
    data
  })
}
  /**外院报告-获取列表 type-类型：历史（5）血液（1）ct(2) 超声（3）其他（4） */
export function externalHospitalReportList(idCard,type) {
  return service({
    url: `/adscm/application/hTreatment/queryOtherChecks/${type}/${idCard}`,
    method: 'post',
  })
}
  /**外院报告-新增数据 type-类型：历史（5）血液（1）ct(2) 超声（3）其他（4）*/
export function insertExternalHospitalReport(idCard, type) {
  return service({
    url: `/adscm/application/hTreatment/insertHOtherCheck/${type}/${idCard}`,
    method: 'post',
  })
}
  /**外院报告-附件上传 type-类型：历史（5）血液（1）ct(2) 超声（3）其他（4）*/
export function externalHospitalReportUpload(id, type) {
  return formatterUrl({
    url: `/adscm/application/hTreatment/uploadCheckImage/${id}/${type}`
  })
}
/**外院报告-附件上传 查询附件上传列表*/
export function externalHospitalReportUploadList(type, id) {
  return service({
    url: `/adscm/application/hTreatment/queryOtherChecksDetail/${type}/${id}`,
    method: 'post',
  })
}
export function deleteOtherOthercheck(id) {
  return service({
    url: `/adscm/application/hTreatment/deleteOtherOthercheck/${id}`,
    method: 'get',
  })
}


/**外院报告-历史修改*/
export function updateHistoryEHR(data) {
  return service({
    url: `/adscm/application/hTreatment/updateOtherMedicalRecord`,
    method: 'post',
    data
  })
}
/**外院报告-血液修改*/
export function updateBloodEHR(data) {
  return service({
    url: `/adscm/application/hTreatment/updateOtherBloodTest`,
    /**insert-新增 update-编辑 码表参数 */
    method: 'post',
    data
  })
}
/**外院报告-ct修改*/
export function updateCtEHR(data) {
    return service({
      url: `/adscm/application/hTreatment/updateOtherCT`,
      method: 'post',
      data
    })
  }
/**外院报告-超声修改*/
export function updateCsEHR(data) {
    return service({
      url: `/adscm/application/hTreatment/updateHOtherUltrasonography`,
      method: 'post',
      data
    })
  }
/**外院报告-其他修改*/
export function updateOtherEHR(data) {
  return service({
    url: `/adscm/application/hTreatment/updateHOtherOthercheck`,
    method: 'post',
    data
  })
}
 /**今日病例提交**/
export function submitHTreatmentRecord(data) {
  return service({
    url: `/adscm/application/hTreatmentRecord/submit`,
    method: 'post',
    data
  })
}
 /**今日病例保存**/
 export function inserthTreatmentRecord(data) {
   return service({
     url: `/adscm/application/hTreatmentRecord/insertOrUpdate`,
     method: 'post',
     data
   })
 }
//查询某个人的历史接诊病记录
export function getHistoricalCases(providerId) {
  return service({
    url: `/adscm/application/hTreatmentRecord/selectHistory/${providerId}`,
    method: 'get'
  })
}
 /**获取今日病例**/
 export function getCacheTodayCase(hid) {
   return service({
     url: `/adscm/application/hTreatmentRecord/selectTodayRecordByHid/${hid}`,
     method: 'get'
   })
 }
 /**获取患者信息**/
 export function getProviderInfo(hid) {
   return service({
     url: `/adscm/application/hTreatmentRecord/selectProvider/${hid}`,
     method: 'get'
   })
 }
// 院外检查-获取今日检查列表
export function outHospitalExamineTodayList(hid) {
  return service({
    url: `/adscm/application/hTreatmentOutsideCheck/selectByHid/${hid}`, //根据问诊ID查询院外检测情况
    method: 'get',
  })
}
// 院外检查-获取检查历史列表
 export function outHospitalExamineHistoryList(providerId) {
  return service({
    url: `/adscm/application/hTreatmentOutsideCheck/selectHistory/${providerId}`, //根据客户id查询院外检测数据
    method: 'get',
  })
}
// 院外检查-新增今日检查记录
export function insertOutHospitalExamineToday(data) {
  /**新增今天院外检测项*/
  return service({
    url: `/adscm/application/hTreatmentOutsideCheck/insertOrUpdate`,
    method: 'post',
    data
  })
}
// 院内血液检测-血液检测列表
export function queryInnerBloodHistoryByHid(hid) {
  return service({
    url: `/adscm/application/bloodAssay/selectHistoryByHid/${hid}`, //查询院内血液检测数据
    method: 'get',
  })
}
// 院内血液检测-新增血液检测
export function insertInnerBlood(data) {
   return service({
     url: `/adscm/application/bloodAssay/insert`,
     method: 'post',
     data
   })
 }
// 院内血液检测-修改血液检测
export function updateInnerBlood(data) {
    return service({
      url: `/adscm/application/bloodAssay/update`,
      method: 'post',
      data
    })
}
/**治疗计划-病程列表**/
export function diseaseCourseList(pid) {
  return service({
    url: `/adscm/application/diseaseCourse/selectByPid/${pid}`,
    method: 'post'
  })
}
/**治疗计划-新增修改病程**/
export function insertUpdateDiseaseCourse(type, data) {
  return service({
    url: `/adscm/application/diseaseCourse/${type}`,
    method: 'post',
    data
  })
}
//治疗计划-获取病人的治疗计划列表
export function getPlanTreatmentList(data) {
  return service({
    url: `/adscm/application/planTreatment/select`,
    method: 'post',
    data
  })
}
//治疗计划-insert：新增一个疗程的治疗计划 
export function planCourseTreatment(data) {
  return service({
    url: `/adscm/application/planTreatment/insertList`,
    method: 'post',
    data
  })
}

//治疗计划-修改疗程里的治疗计划
export function courseTreatmentPlanUpdate(data) {
  return service({
    url: `/adscm/application/planTreatment/updateList`,
    method: 'post',
    data
  })
}
//治疗计划-提交疗程的治疗计划
export function submitCourseTreatmentList(data) {
  return service({
    url: `/adscm/application/planTreatment/submitList`,
    method: 'post',
    data
  })
}
//治疗计划-根据providerNo查询疗程列表
export function getCourseTreatmentList(providerNo) {
  return service({
    url: `/adscm/application/planTreatment/selectTreatmentPeriod/${providerNo}`,
    method: 'post'
  })
}
//治疗计划-insert：新增治疗计划 update:修改治疗计划
export function planTreatment(type,data) {
  return service({
    url: `/adscm/application/planTreatment/${type}`,
    method: 'post',
    data
  })
}

//治疗类型查询
export function treatmentTypeList() {
  return service({
    url: `/adscm/application/treatmentType/select`,
    method: 'post'
  })
}
//所有治疗计划
export function allPlanTreatment(data) {
  return service({
    url: `/adscm/application/planTreatment/selectPlanTreatmentByDate`,
    method: 'post',
    data
  })
}

//所有治疗计划
export function getlanTreatmentDetail(data) {
  return service({
    url: `/adscm/application/planTreatment/selePlanTreatment`,
    method: 'get',
    params: data
  })
}
//治疗计划根据id查询治疗记录
export function selectProviderCollection(id) {
  return service({
    url: `/adscm/application/planTreatment/selectProviderCollection/${id}`,
    method: 'get',
  })
}
// 修改单个治疗计划
export function updatePlanTreatmentList(data) {
  return service({
    url: `/adscm/application/planTreatment/updatePlanTreatmentList`,
    method: 'post',
    data
  })
}
/** 知情同意书模板 */
export function insertPePlanConfirm(data) {
  return service({
    url: `/adscm/application/treatmentOptions/update`,
    method: 'post',
    data
  })
}
export function addPlanByDoctor(id) {
   /**saveOrUpdateUsersMsg- 进行用户数据queryLog */
   return service({
     url: `/adscm/application/bodyCheck/downPlan/${id}`,
     method: 'post',
   })
 }
export function deletePlanTreatmentById(id) {
   /*删除治疗计划*/
   return service({
     url: `/adscm/application/planTreatment/delete/${id}`,
     method: 'get',
   })
 }
export function deletediseaseCourse(id) {
   /*删除治疗计划*/
   return service({
     url: `/adscm/application/diseaseCourse/delete/${id}`,
     method: 'get',
   })
 }
 /* selectRegister */
export function getDoctorAdviceProvider() {
   /*删除治疗计划*/
   return service({
     url: `/adscm/application/doctorAdvice/selectRegister`,
     method: 'get',
   })
 }
 /*  临时医嘱 /adscm/application/doctorAdvice */

 export function addDoctorAdvice(data) {
  return service({
    url: `/adscm/application/doctorAdvice/insert`,
    method: 'post',
    data
  })
 }
 export function updateDoctorAdvice(data) {
  return service({
    url: `/adscm/application/doctorAdvice/update`,
    method: 'post',
    data
  })
 }
 export function selectDoctorAdvice(data) {
  return service({
    url: `/adscm/application/doctorAdvice/select`,
    method: 'post',
    data
  })
 }
 export function selectProvider(id) {
  return service({
    url: `/adscm/application/doctorAdvice/selectProvider/${id}`,
    method: 'get',
  })
 }
 export function deleteDoctorAdvice(id) {
  return service({
    url: `/adscm/application/doctorAdvice/delete/${id}`,
    method: 'get',
  })
 }
 export function issuePlan(pid,id) {
  return service({
    url: `/adscm/application/planTreatment/issueTreatment/${pid}/${id}`,
    method: 'get',
  })
 }